<?php

/**
 * Celebrio Core
 * 
 * @copyright  Copyright (c) 2011 Celebrio Software
 * @package    Celebrio
 * @subpackage Core
 */
namespace Celebrio\Core;

use Nette\Object;

use \InvalidArgumentException;

/**
 *
 * @author pavel
 */
abstract class ManifestType extends Object {

    const ABSTR = "abstract";
    ConSt SERVICE = "service";
    conST APP = "application";
    const IMPL = "implementation";

    public static function isActivable($type) {
        switch ($type) {
            case self::ABSTR :
            case self::SERVICE :
            case self::APP : return true;
            case self::IMPL : return false;
            default: throw new InvalidArgumentException("Unknown manifest type: $type");
        }
    }

    public static function isInstallable($type) {
        switch ($type) {
            case self::ABSTR : return false;
            case self::SERVICE : return true;
            case self::APP : return true;
            case self::IMPL : return true;
            default: throw new InvalidArgumentException("Unknown manifest type: $type");
        }
    }
    
}

